#ifndef HANDLER_HEADER_
#define HANDLER_HEADER_

#include <queue>
#include <winsock2.h>
#include "MemoryBlock.h"

class Handler
{
public:
	Handler();
	virtual ~Handler();
	bool sendMsg(const char* msg,int len);
	bool recvMsg();
	virtual void start();
	void setHandle(SOCKET sock){ clientSock = sock; }
	virtual void onReceiveMessage(const MemoryBlock& block){}
	virtual void onClose() 
	{
		closesocket(clientSock);
	}
private:
	SOCKET clientSock;
};

#endif